package com.xbongbong.saas.domain.entity;

import com.xbongbong.paas.toolbox.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author feng.zheng
 * @version v1.0
 * @date 2019/2/1 14:14
 * @since v1.0
 */
@Setter
@Getter
@ToString
public class CustomerInvoiceEntity implements Serializable {

    private static final long serialVersionUID = -8164395867653509756L;
    // 主键
    private Long id;
    // 公司id
    private String corpid;
    // 客户id
    private Long customerId;
    // 抬头类型(1:企业，2:个人)
    private String titleType;
    // 发票抬头
    private String title;
    // 纳税识别号
    private String taxpayerNo;
    // 注册电话
    private String registeredPhone;
    // 开户行
    private String bank;
    // 开户账号
    private String account;
    // 开票地址
    private String invoiceAddress;
    // 创建人id
    private String creatorId;
    // 创建人姓名
    private String creatorName;
    // 最近修改人id
    private String modifierId;
    // 最近修改人名称
    private String modifierName;
    // 添加时间
    private Long addTime;
    // 更新时间
    private Long updateTime;
    // 删除标记
    private Integer del;
    //是否默认地址 0：否，1：是
    private Integer isDefault;

    public CustomerInvoiceEntity() {
        corpid = "";
        customerId = 0L;
        titleType = "0";
        title = "";
        taxpayerNo = "";
        registeredPhone = "";
        bank = "";
        account = "";
        invoiceAddress = "";
        creatorId = "";
        creatorName = "";
        modifierId = "";
        modifierName = "";
        addTime = (long) DateUtil.getInt();
        updateTime = (long) DateUtil.getInt();
        del = 0;
        isDefault = 0;
    }

    /**
     * 获取 抬头类型解释
     * @return
     * @author zheng.li
     * @time 2017-5-9 上午9:30:52
     */
    public String getTitleTypeStr(){
        if(this.titleType==null){
            return "";
        }
        String titleTypeStr = "";
        if(Objects.equals(this.titleType,"1") ){
            titleTypeStr = "企业";
        }else if(Objects.equals(this.titleType, "2")){
            titleTypeStr = "个人";
        }
        return titleTypeStr;
    }
}
